CreateColorByName
Creates a color selecting it from one of the available color presets.
Syntax
expression.CreateColorByName(sPresetColor);
expression
- A variable that represents a Api class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
sPresetColor | Required | PresetColor | A preset selected from the list of the available color preset names. |
Returns
Example
This example creates a color selecting it from one of the available color presets.
var oWorksheet = Api.GetActiveSheet();
var oColor = Api.CreateColorByName("peachPuff");
oWorksheet.GetRange("A2").SetValue("Text with color");
oWorksheet.GetRange("A2").SetFontColor(oColor);